  <!DOCTYPE html>
  <html>

  <head>
      <meta name="layout" content="main2" />
      <g:set var="entityName" value="${message(code: 'activity.label', default: 'activity')}" />
      <title>我的工时</title>
      <style>
        .table td, .table th {
            padding: 0.43rem;
            line-height: 33px;
        }

      </style>
  </head>

  <body>
      <div class="main-body">
          <div class="page-wrapper">
              <!-- Page-header start -->
              <div class="page-header">
                  <div class="page-header-title">
                      <h4>我的工时</h4>
                  </div>

                  <div class="page-header-breadcrumb">
                      <ul class="breadcrumb-title">
                          <li class="breadcrumb-item">
                              <a href="/salesDashboard/index">
                                  <i class="icofont icofont-home"></i>
                              </a>
                          </li>
                          <li class="breadcrumb-item"><a href="#!">我的工时</a>
                          </li>
                      </ul>
                  </div>
              </div>
              <!-- Page-header end -->
              <!-- Page-body start -->
              <div class="page-body">
                  <!-- Hover table card start -->
                  <div class="card">
                      <div class="card-header">
                          <h5>我的工时</h5>

                          <div class="card-header-right">
                          </div>
                      </div>

                      <div class="card-block">

                          <div class="dt-responsive table-responsive">
                              <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">

                                  <g:form method="POST" action="taskTime">
                                      <div class="row m-0">
                                          <div class="col-md-10 p-l-0">
                                          <div id="dom-jqry_filter" class="text-left">
                                              <label class="block">

                                              <div class="form-group row">
                                                <div class="col-md-3">
                                              <input type="text" valctrl="actualStartTime" value="${params?.actualStartTime}" placeholder="实际开始时间" class="form-control form_date">
                                              <input type="hidden" id="actualStartTime" name="actualStartTime" value="date.struct">
                                              <input type="hidden" id="actualStartTime_day" name="actualStartTime_day" value="">
                                              <input type="hidden" id="actualStartTime_month" name="actualStartTime_month" value="">
                                              <input type="hidden" id="actualStartTime_year" name="actualStartTime_year" value="">
                                              </div>
                                              <div class="col-md-3">
                                              <input type="text" valctrl="actualEndTime" value="${params?.actualEndTime}" placeholder="结束时间" class="form-control form_date">
                                              <input type="hidden" id="actualEndTime" name="actualEndTime" value="date.struct">
                                              <input type="hidden" id="actualEndTime_day" name="actualEndTime_day" value="">
                                              <input type="hidden" id="actualEndTime_month" name="actualEndTime_month" value="">
                                              <input type="hidden" id="actualEndTime_year" name="actualEndTime_year" value="">
                                              </div>
                                            </div>
                                              </label>
                                          </div>

                                      </div>
                                          <div class="col-md-2 p-r-0 dt-buttons text-right">
                                              <button class="btn btn-inverse btn-sm btn-squeare" type="submit"><i class="fa fa-search"></i></button>
                                              <button class="btn btn-inverse btn-sm btn-squeare" type="button" id="resetBtn"><i class="fa fa-refresh"></i></button>
                                          </div>
                                        </div>
                                  </g:form>
                                  </div>
                              </div>

                              <table class="table table-striped  table-bordered table-hover">
                                  <thead>
                                      <tr>
                                          <g:sortableColumn property="id" title="编号" />
                                          <g:sortableColumn property="name" title="标题" />
                                          <g:sortableColumn property="assignedTo" title="执行人" />
                                          <g:sortableColumn property="user" title="指派人" />
                                          <g:sortableColumn property="account" title="客户" />
                                          <g:sortableColumn property="actualStartTime" title="实际开始时间" />
                                          <g:sortableColumn property="actualEndTime" title="实际结束时间" />
                                          <g:sortableColumn property="createdDate" title="工时(小时)" />
                                          <g:sortableColumn property="rating" title="工时系数" />
                                          <g:sortableColumn property="rating" title="实际工时" />
                                      </tr>
                                  </thead>
                                  <tbody>
                                      <g:each in="${activityList}">
                                          <tr>
                                            <td>
                                                <g:link action="show" id="${it.id}" class="firstTd">${it?.id}</g:link>
                                            </td>
                                              <td>
                                                  <g:link action="show" id="${it.id}" class="firstTd">${it?.name}</g:link>
                                              </td>
                                              <td>${it?.assignedTo}</td>
                                              <td>${it?.user}</td>
                                              <td>${it?.account}</td>
                                              <td><g:formatDate date="${it?.actualStartTime}" format="yyyy-MM-dd HH:mm:ss"></g:formatDate></td>
                                              <td><g:formatDate date="${it?.actualEndTime}" format="yyyy-MM-dd HH:mm:ss"></g:formatDate></td>
                                              <td>
                                                <g:if test="${it?.actualStartTime && it?.actualEndTime}">
                                                  ${(it?.actualEndTime?.time - it?.actualStartTime?.time)/1000/60/60}
                                                </g:if>
                                              </td>
                                              <td>
                                                ${it?.rating}
                                              </td>
                                              <td>
                                                <g:if test="${it?.actualStartTime && it?.actualEndTime}">
                                                  ${(it?.actualEndTime?.time - it?.actualStartTime?.time)/1000/60/60 * it?.rating}
                                                </g:if>
                                              </td>
                                          </tr>
                                      </g:each>
                                  </tbody>
                              </table>

                              <div class="row m-0">
                                <div class="col-xs-12 col-sm-12 col-md-5">
                                  <div class="dataTables_info" id="dom-jqry_info" role="status" aria-live="polite">每页10条，共${activityCount}条</div>
                                </div>
                                <div class="col-xs-12 col-sm-12 col-md-7">
                              <div class="dataTables_paginate" id="dom-jqry_paginate">
                                   <div class="pagination">
                                      <g:paginate total="${activityCount ?: 0}" params="${params}" />

                                   </div>
                              </div>
                              </div>
                              </div>

                          </div>

                      </div>


              <!-- Hover table card end -->
          </div>

          <!-- Page-body end -->
      </div>
      </div>
      <g:javascript>

          $(function () {
          $("#resetBtn").click(function () {
              $(".form_date").val("");
              $(".form_date").change();
          })
      });

      </g:javascript>
  </body>

  </html>
